package com.lefull.lefullbase.utils.OkGoHelper;

import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;

import java.io.StringReader;

public class SafeGson {
    public Gson gson;

    public SafeGson(Gson gson) {
        this.gson = gson;
    }

    public <T> T fromJson(String json, Class<T> classOfT) throws JsonSyntaxException {
        SafeJsonReader reader = new SafeJsonReader(new StringReader(json));
        return this.gson.fromJson(reader, classOfT);
    }
}
